import React from 'react'
import { ConfigProvider } from 'antd' // 国际化的
import zhCN from 'antd/lib/locale/zh_CN' // 简体中文语言包
import enUS from 'antd/lib/locale/en_US' // 美式英文语言包

import { useAppSelector } from '@/app/hooks' // redux
import { selectLang } from '@/app/slice' // useSelector里面的回调

import { RenderRoutes } from './routes'  // ?

function App() {
  const lang = useAppSelector(selectLang)

  return (
    <ConfigProvider locale={lang === 'zh_CN' ? zhCN : enUS}>
      {RenderRoutes()}
    </ConfigProvider>
  )
}

export default App
